package UIFree
{
	import flash.geom.Matrix;
	import flash.geom.Rectangle;
	
	public class uif_hotspot extends uif_ecomponent {
		public function uif_hotspot(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, styleClass:String='') {
			super(parent, ax, ay, awidth, aheight, styleClass);
		}
	
		override protected function paint(a_styleClass: String, a_method: String='draw_rect'): void {
			var mat: Matrix 			= new Matrix();
			var hsRect: Rectangle 	 	= getBorder();
			var rounds: Array 			= getRounds(style);
			var round: Number 			= (rounds[0] + rounds[1]) * 0.4;
			var round2: Number 			= round * 0.5;
			
			hsRect.height =  hsRect.height * (style['heightPercent']?style['heightPercent']:0.5);
			begin2(style);
			
			graphics.moveTo(hsRect.x + rounds[0], hsRect.y);
			graphics.lineTo(hsRect.x + hsRect.width - rounds[1], hsRect.y);
			graphics.curveTo(hsRect.x + hsRect.width, hsRect.y, hsRect.x + hsRect.width, hsRect.y + rounds[1]);
			graphics.lineTo(hsRect.x + hsRect.width, hsRect.y + hsRect.height -  rounds[2]);
			graphics.curveTo(hsRect.x + hsRect.width, hsRect.y + hsRect.height, hsRect.x + hsRect.width -  rounds[2], hsRect.y + hsRect.height);
			
			graphics.curveTo(hsRect.x + hsRect.width * 1/2, hsRect.y + hsRect.height * 1/3, hsRect.x +  rounds[3], hsRect.y + hsRect.height);
//			graphics.lineTo(hsRect.x + rounds[3], hsRect.y + hsRect.height);
			graphics.curveTo(hsRect.x, hsRect.y + hsRect.height, hsRect.x, hsRect.y + hsRect.height - rounds[3]);
			graphics.lineTo(hsRect.x, hsRect.y + rounds[0]);
			graphics.curveTo(hsRect.x, hsRect.y, hsRect.x + rounds[0], hsRect.y);
			graphics.endFill();
		}
		
	}
}